import {Component, Input, OnInit} from '@angular/core';
import {Router} from "@angular/router";

@Component({
    selector: 'app-main-header',
    templateUrl: './main-header.component.html',
    styleUrls: ['./main-header.component.scss', '../header/header.component.scss'],
})
export class MainHeaderComponent implements OnInit {
    @Input() showBack: boolean;
    @Input() showClose: boolean;
    @Input() title: string;
    @Input() specialClass: string;

    constructor(private route: Router,) {
    }

    ngOnInit() {
    }

    goToLastPage() {
        if (this.showBack) {
            history.go(-1);
        }
    }

    goToPage() {
        this.route.navigate([`/tabs/main`]).then();
    }

}
